from rest_framework.permissions import BasePermission


class HlqPermission(BasePermission):
    message = {"status": False, "error": "需要登录才可以继续访问"}

    def has_permission(self, request, view):
        if request.method == 'GET':
            return True

        if request.user:
            return True
        return False